package ysc.cqnu.operdb.serviceImpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import ysc.cqnu.operdb.entity.ResultData;
import ysc.cqnu.operdb.mapper.DiaoKeMapper;
import ysc.cqnu.operdb.service.DeleteDiaoKeInfoService;

@Service
public class DeleteDiaoKeInfoServiceImpl implements DeleteDiaoKeInfoService {
    @Autowired
    private ResultData resultData;
    @Autowired
    private DiaoKeMapper diaoKeMapper;
    @Override
    public ResultData deleteDiaoKeInfoService(String id) {
        try {
            diaoKeMapper.deleteDiaoKeInfoByid(id);
            String count =String.valueOf(diaoKeMapper.count());
            resultData.data=count;
            resultData.flag="deleteSuccess";
            return resultData;
        }catch (Exception e){
            System.out.println(e);
            resultData.data=null;
            resultData.flag="deleteFail";
            return resultData;
        }
    }
}
